/**
 * 1081. 不同字符的最小子序列
 * https://leetcode-cn.com/problems/smallest-subsequence-of-distinct-characters/
 */
public class Solutions_1081 {
    public static void main(String[] args) {
//        String str = "cdadabcc";  // output: "adbc"
//        String str = "abcd";  // output: "abcd"
//        String str = "ecbacba";  // output: "eacb"
        String str = "leetcode";  // output: "letcod"

        String result = smallestSubsequence(str);
        System.out.println(result);
    }

    public static String smallestSubsequence(String s) {
        return Solutions_316.removeDuplicateLetters(s);
    }
}
